const std = @import("std");
const stdout = std.io.getStdOut().writer();
const expect = @import("std").testing.expect;

const User = struct {
    id: usize,
    name: []const u8,

    pub fn init(id: usize, name: []const u8) User {
        return .{ .id = id, .name = name };
    }
};

pub fn main() !void {
    try stdout.print("Result: {s}!\n", .{"hello world"});
    // ############################
    //这里添加测试的代码
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
    const allocator = gpa.allocator();
    const user = try allocator.create(User);
    defer allocator.destroy(user);
    user.* = User.init(0, "fang");
    // ############################
}

test "test main" {
    const n = 8;
    try stdout.print("Result: {d}!\n", .{n});
}
